Ext.define('Admin.view.role.manager.RoleManagerAddForm', {
    extend: 'Ext.form.Panel',
    alias: 'widget.roleManagerAddForm',
    xtype: 'roleManagerAddForm',

    requires: [
        'Ext.form.field.Text',
        'Ext.form.field.File',
        'Ext.form.field.Date',
        'Ext.form.field.Radio',
        'Ext.button.Button'
    ],

    controller: 'roleManagerViewController',

    defaultType: 'textfield',

    layout: {
        type: 'vbox',
        align: 'stretch'
    },

    items: [{
            fieldLabel: '角色名',
            name: 'role',
            allowBlank: false,
            blankText: '此项不能为空'
        },
        {
            xtype: 'tagfield',
            fieldLabel: '权限',
            name: 'group',
            store: Ext.create('Admin.store.role.GroupStore'),
            displayField: 'name',
            valueField: 'id',
            filterPickList: true,
            forceSelection: false
        },
    ],

    buttons: ['->',
        {
            text: '取消',
            listeners: {
                click: 'onFormCancelButton'
            }
        }, {
            text: '保存',
            formBind: true,
            ui: 'soft-green',
            listeners: {
                click: 'onAddFormSubmitButton'
            }
        }
    ]

});